package com.serkol.driving.learning.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 
 * @TableName exam_result
 */
@TableName(value ="exam_result")
@Data
public class ExamResult implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 
     */
    private Long userId;

    /**
     * 
     */
    private Integer examCount;

    /**
     * 
     */
    private Integer integral;

    /**
     * 
     */
    private Integer qualified;

    /**
     * 
     */
    private Integer failed;

    /**
     * 
     */
    private boolean success;

    /**
     * 
     */
    private String examTime;

    /**
     * 
     */
    private Date createDate;

    /**
     * 
     */
    private Date updateDate;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ExamResult other = (ExamResult) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getExamCount() == null ? other.getExamCount() == null : this.getExamCount().equals(other.getExamCount()))
            && (this.getIntegral() == null ? other.getIntegral() == null : this.getIntegral().equals(other.getIntegral()))
            && (this.getQualified() == null ? other.getQualified() == null : this.getQualified().equals(other.getQualified()))
            && (this.getFailed() == null ? other.getFailed() == null : this.getFailed().equals(other.getFailed()))
            && (this.isSuccess() == false ? other.isSuccess() == false : this.isSuccess()==other.isSuccess())
            && (this.getExamTime() == null ? other.getExamTime() == null : this.getExamTime().equals(other.getExamTime()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getExamCount() == null) ? 0 : getExamCount().hashCode());
        result = prime * result + ((getIntegral() == null) ? 0 : getIntegral().hashCode());
        result = prime * result + ((getQualified() == null) ? 0 : getQualified().hashCode());
        result = prime * result + ((getFailed() == null) ? 0 : getFailed().hashCode());
      //  result = prime * result + ((isSuccess() == false) ? 0 : isSuccess().);
        result = prime * result + ((getExamTime() == null) ? 0 : getExamTime().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", examCount=").append(examCount);
        sb.append(", integral=").append(integral);
        sb.append(", qualified=").append(qualified);
        sb.append(", failed=").append(failed);
        sb.append(", success=").append(success);
        sb.append(", examTime=").append(examTime);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}